<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../../editing/assert_selection.js"></script>
<script>
const kStyle = [
  '<style>',
    '#before::before {',
    '  display: inline-block;',
    '  content: "before";',
    '}',
    '#start::after {',
    '  display: inline-block;',
    '  content: "after";',
    '}',
  '</style>',
].join('');

selection_test(
  // Note: newline characters are significant. When we omit them, the result
  // HTML has both #before and #start.
  [
    kStyle,
    '<div contenteditable>\n',
      '<span id="before"></span>|',
      '<span>text</span>',
     '^<span id="start"></span>\n',
    '</div>',
  ].join(''),
  'insertLineBreak',
  [
    kStyle,
    '<div contenteditable><br>|<br></div>',
  ].join(''),
  'Replace selection with BR');
</script>
